473,420 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,420 software developers and data experts.

Arrow Submenu Indicators

Can anyone please help me? I need to add arrows to my JavaScript submenu to indicate that one of my submenu items have a child menu with options.
How can I do that in JavaScript without inserting graphics? I only need to show like a > greater than symbol or something like that.
Oct 2 '07 #1
11 2698
acoder
16,027 Expert Mod 8TB
Post your current code, so that we can work with that.
Oct 2 '07 #2
Post your current code, so that we can work with that.
Hi Acoder and thanks for your quick reply,
Here is where I have each submenu defined:

Expand|Select|Wrap|Line Numbers
  1. if (!exclude) { //********
  2. //************************
  3.  
  4.  
  5. // *** POSITIONING AND STYLES *********************************************
  6.  
  7.  
  8. var menuALIGN = "center";        // alignment
  9. var absLEFT =     0;        // absolute left or right position (if not center)
  10. var absTOP =     128;         // absolute top position
  11.  
  12. var staticMENU = false;        // static positioning mode (ie5/6 and ns4 only)
  13.  
  14. var stretchMENU = false;        // show empty cells
  15. var showBORDERS = false;        // show empty cell borders
  16.  
  17. var baseHREF = "resources/";
  18. var zORDER =     1000;        // base z-order of nav structure (not ns4)
  19.  
  20. var mCOLOR =     "#339999";    // main nav cell color
  21. var rCOLOR =     "#006666";    // main nav cell rollover color
  22. var keepLIT =    true;        // keep rollover color when browsing menu
  23. var bSIZE =     1;        // main nav border size
  24. var bCOLOR =     "#006666"    // main nav border color
  25. var aLINK =     "#FFCC00";    // main nav link color
  26. var aHOVER =     "#FFFF99";        // main nav link hover-color (dual purpose)
  27. var aDEC =     "none";        // main nav link decoration
  28. var fFONT =     "Verdana,Tahoma,Helvetica";    // main nav font face        
  29. var fSIZE =     11;        // main nav font size (pixels)    
  30. var fWEIGHT =     "bold"        // main nav font weight
  31. var tINDENT =     7;        // main nav text indent (if text is left or right aligned)
  32. var vPADDING =     2;        // main nav vertical cell padding
  33. var vtOFFSET =     0;        // main nav vertical text offset (+/- pixels from middle)
  34.  
  35. var vOFFSET =     -5;        // shift the submenus vertically
  36. var hOFFSET =     4;        // shift the submenus horizontally
  37.  
  38. var smCOLOR =     "#339999";    // submenu cell color
  39. var srCOLOR =     "#006666";    // submenu cell rollover color
  40. var sbSIZE =     1;        // submenu border size
  41. var sbCOLOR =     "006666"    // submenu border color
  42. var saLINK =     "#FFCC00";    // submenu link color
  43. var saHOVER =     "#FFFF99";        // submenu link hover-color (dual purpose)
  44. var saDEC =     "none";        // submenu link decoration
  45. var sfFONT =     "Verdana,Tahoma,Helvetica";// submenu font face        
  46. var sfSIZE =     11;        // submenu font size (pixels)    
  47. var sfWEIGHT =     "normal"    // submenu font weight
  48. var stINDENT =     5;        // submenu text indent (if text is left or right aligned)
  49. var svPADDING = 2;        // submenu vertical cell padding
  50. var svtOFFSET = 0;        // submenu vertical text offset (+/- pixels from middle)
  51.  
  52. var shSIZE =    0;        // menu drop shadow size 
  53. var shCOLOR =    "#";    // menu drop shadow color
  54. var shOPACITY = 75;        // menu drop shadow opacity (not ie4/ns4/op5)
  55.  
  56. var keepSubLIT=    true;        // keep submenu rollover color when browsing child menu    
  57. var chvOFFSET = -3;        // shift the child menus vertically             
  58. var chhOFFSET = -5;        // shift the child menus horizontally         
  59.  
  60. var closeTIMER = 330;        // menu closing delay time
  61.  
  62. var cellCLICK = true;        // links activate on TD click
  63. var aCURSOR = "hand";        // cursor for active links (not ns4 or op5)
  64.  
  65. var altDISPLAY = "title";    // where to display alt text
  66. var allowRESIZE=true;        // allow resize/reload
  67.  
  68.  
  69. //** LINKS ***********************************************************
  70.  
  71.  
  72. // add main link item ("url","Link name",width,"text-alignment","_target","alt text",top position,left position,"key trigger")
  73. addMainItem("index.htm","Home",65,"center","","home",0,0,""); 
  74.  
  75. addMainItem("","Facts",65,"center","","",0,0,""); 
  76.  
  77.     defineSubmenuProperties(170,"left","left",0,0);
  78.  
  79.     addSubmenuItem("general.htm","General info","","");
  80.         addSubmenuItem("quick.htm","A quick glance","","");
  81.     addSubmenuItem("curriculum.htm","curriculum","","");
  82. // HERE IS WHERE I DEFINE THE CHILD MENU
  83.                    defineChildmenuProperties(164,"left","center",0,0);
  84.                    addChildmenuItem("http://www.example.com","Escuela Internacional","","");
  85.  
  86. // END OF FIRST CHILD MENU
  87.  
  88.     addSubmenuItem("history.html","History","","");
  89.     addSubmenuItem("newsletter_latest.php","Read latest newsletter","","");
  90.     addSubmenuItem("newsletter_all.php","Read all newsletters","","");
  91.     addSubmenuItem("announcement_all.php","Read all announcements","","");
  92.  
  93.  
  94. addMainItem("","Administration",110,"center","","",0,0,""); 
  95.  
  96.     defineSubmenuProperties(180,"left","left",0,0);
  97.  
  98.     addSubmenuItem("staff2005.htm","Staff introduction 2005-2006","","");
  99.     addSubmenuItem("staff.htm","Staff introduction 2006-2007","","");
  100.     addSubmenuItem("directors.htm","Board of directors","","");
  101.  
  102. addMainItem("","Admission",80,"center","","",0,0,""); 
  103.  
  104.     defineSubmenuProperties(150,"left","left",0,0);
  105.  
  106.     addSubmenuItem("registration.htm","Policy and registration","","");
  107.     addSubmenuItem("fees.htm","Tuition and fees","","");
  108.     addSubmenuItem("forms.htm","Download forms","","");
  109.     addSubmenuItem("scholarship.htm","Scholarship","","");
  110.  
  111. addMainItem("","Associations",92,"center","","",0,0,""); 
  112.  
  113.     defineSubmenuProperties(170,"left","right",0,0);
  114.  
  115.     addSubmenuItem("assoc.htm","PTA, SACS, Student Council","","");
  116.  
  117. addMainItem("","Calendar",80,"center","","",0,0,""); 
  118.  
  119.     defineSubmenuProperties(80,"center","left",0,0);
  120.  
  121.     addSubmenuItem("calendar2006.htm","2006 - 2007","","");
  122.     addSubmenuItem("calendar2007.htm","2007 - 2008","","");
  123.  
  124.  
  125. addMainItem("","Employment",92,"center","","",0,0,""); 
  126.  
  127.     defineSubmenuProperties(150,"left","left",0,0);
  128.  
  129.     addSubmenuItem("opportunities.htm","opportunities","","");
  130.         addSubmenuItem("benefit.htm","teacher benefit package","","");
  131.         addSubmenuItem("application.asp","application","","");
  132.         addSubmenuItem("application.htm","job application form","","");
  133.  
  134.  
  135. addMainItem("","Pictures",80,"center","","",0,0,""); 
  136.  
  137.     defineSubmenuProperties(80,"left","left",0,0);
  138.  
  139.     addSubmenuItem("campus.htm","campus","","");
  140.         addSubmenuItem("activieties.htm","activities","","");
  141.  
  142.  
  143. addMainItem("","Contact",80,"center","","",0,0,""); 
  144.  
  145.     defineSubmenuProperties(80,"right","left",0,0);
  146.  
  147.     addSubmenuItem("contact.htm","contact info","","");
  148.  
  149.  
  150. //**DO NOT EDIT THIS *****
  151. }//***********************
  152. //************************
Oct 3 '07 #3
acoder
16,027 Expert Mod 8TB
Can you not just add it manually using >?

If not, you'll need to show the code for adding the sub menu.
Oct 3 '07 #4
Can you not just add it manually using >?

If not, you'll need to show the code for adding the sub menu.
Hi Acoder,
What do you mean with >
Oct 3 '07 #5
Can you not just add it manually using >?

If not, you'll need to show the code for adding the sub menu.
Ok, let's see. I have this other program that works with the other one and this is where I define all of my functions. Is it this what you need?


Expand|Select|Wrap|Line Numbers
  1. var exclude=true; var agt=navigator.userAgent.toLowerCase();
  2. var ie=false; var ie4=false; var ie5=false; var op5=false; var konqi=false;
  3. if (document.all&&(agt.indexOf('msie')!=-1)) {
  4. ie=true; ie4=true; exclude=false;
  5. if (agt.indexOf('msie 4')==-1) { ie5=true; ie4=false; }
  6. if (agt.indexOf('opera')!=-1) { ie=false; ie4=false; ie5=false; op5=true; }
  7. }
  8. var ns6=false; var mz7=false;
  9. if (document.getElementById&&!ie) {
  10. ns6=true; exclude=false;
  11. if (agt.indexOf('netscape6')==-1) {
  12. ns6=false; mz7=true;
  13. }
  14. if (window.opera) { mz7=false; op5=true;}
  15. else if (agt.indexOf('gecko')==-1) { mz7=false; exclude=true; }
  16. }
  17. if (agt.indexOf('opera 4')!=-1) { op5=false; mz7=false; exclude=true; }
  18. var ns4=false;
  19. if ((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)&&!ie&&!op5&&!ns6&&!mz7) {
  20. ns4=true; exclude=false;
  21. }
  22. if (agt.indexOf('webtv')!=-1) { ie=false; ie4=false; exclude=true; }
  23. var win=true; var mac=false;
  24. if (agt.indexOf('mac')!=-1) { win=false; mac=true; }
  25. //djochange - added the following code to find Konqueror
  26. if (navigator.vendor){
  27. if (navigator.vendor =="KDE") {
  28. ie=false;
  29. ie4=false;
  30. ie5=false;
  31. konqi = true;
  32. ns6=true;
  33. ns4 = false;
  34. exclude = false;
  35.  
  36. // exclude earlier than kde2.2
  37. var thisKDE=agt;
  38. var splitKDE=thisKDE.split("konqueror/");
  39. var aKDE=splitKDE[1].split("; ");
  40. var KDEn=parseFloat(aKDE[0]);
  41. var oldKde=false;
  42. if(KDEn<2.2){oldKde=true;exclude=true;ns6=false;konqi=false;}
  43. }
  44. }
  45. //end djochange
  46. // differentiate between opera 5 and 6
  47. var op6=false;
  48. if(op5){
  49. if((agt.indexOf("opera 6")!=-1)||(agt.indexOf("opera/6")!=-1)){op6=true;op5=false;}
  50. }
  51.  
  52.  
  53. // array building functions for custom.js
  54. var mu="mu";var m=0;var sm=0;var cm=0;var sp=0;
  55. var mI=new Array;
  56. var sP=new Array;
  57. var sI=new Array;
  58. var cP=new Array;
  59. var cI=new Array;
  60.  
  61. function addMainItem(ma,mb,mc,md,me,mf,mg,mh,mi){
  62. sm=0;
  63. if(!mb||mb==""){mb="&nbsp;";}
  64. while(mb.indexOf('<BR>')!=-1){mb=mb.replace('<BR>','<br>');}
  65. if (!me||me==""){me="_self";}
  66. if (!mf||mf==""||altDISPLAY==""){mf="none";}
  67. if(!mg){mg=0;}if(!mh){mh=0;}
  68. if(!mi||mi==""||mi=="c"||mi=="C"){mi="-";}
  69. if(mi!="-"){mi=mi.toLowerCase();}
  70. mI[m]=new Array(ma,mb,mc,md,me,mf,mg,mh,mi);
  71. m++;
  72. }
  73.  
  74. function defineSubmenuProperties(spa,spb,spc,spd,spe){
  75. if(!spd){spd=0;}
  76. if(!spe){spe=0;}
  77. sP[(m-1)]=new Array(spa,spb,spc,spd,spe);
  78. if (sm==0){
  79. sI[(m-1)]=new Array; cP[(m-1)]=new Array; cI[(m-1)]=new Array;
  80. }
  81. }
  82.  
  83. function addSubmenuItem(sma,smb,smc,smd){
  84. cm=0;var sme=true;
  85. if(sme&&sma=="~"){sme=false;sma="";}
  86. if (!sma||sma==""){sma="#";}
  87. if (!smb||smb==""){smb="&nbsp;";}
  88. while(smb.indexOf('<BR>')!=-1){smb=smb.replace('<BR>','<br>');}
  89. if (!smc||smc==""){smc="_self";}
  90. if (!smd||smd==""||altDISPLAY==""){smd="none";}
  91. sI[(m-1)][sm]=new Array(sma,smb,smc,smd,sme);
  92. sm++;
  93. }
  94.  
  95. function defineChildmenuProperties(cpa,cpb,cpc,cpd,cpe){
  96. if(!cpd){cpd=0;}
  97. if(!cpe){cpe=0;}
  98. cP[(m-1)][(sm-1)]=new Array(cpa,cpb,cpc,cpd,cpe);
  99. cI[(m-1)][(sm-1)]=new Array;
  100. }
  101.  
  102. function addChildmenuItem(cma,cmb,cmc,cmd){
  103. var cme=true;
  104. if(cma&&cma=="~"){cme=false;cma="";}
  105. if (!cma||cma==""){cma="#";}
  106. if (!cmb||cmb==""){cmb="&nbsp;";}
  107. while(cmb.indexOf('<BR>')!=-1){cmb=cmb.replace('<BR>','<br>');}
  108. if (!cmc||cmc==""){cmc="_self";}
  109. if (!cmd||cmd==""||altDISPLAY==""){cmd="none";}
  110. cI[(m-1)][(sm-1)][cm]=new Array(cma,cmb,cmc,cmd,cme);
  111. cm++;
  112. }
  113. // custom upgrade backup definitions
  114. var keepSubLIT=true;var chvOFFSET=0;var chhOFFSET=-5;var closeTIMER=330;var cellCLICK=true;var aCURSOR="hand";
  115. var altDISPLAY="";var allowRESIZE=true;
Oct 3 '07 #6
OH MY GOOD,
Nobody can help?
Oct 4 '07 #7
acoder
16,027 Expert Mod 8TB
Hi Acoder,
What do you mean with &gt;
&gt; is a HTML character entity for "greater than" or > (see link).
Oct 4 '07 #8
Hi Acoder,
I try the $gt; but when I upload the program I can only see two options of my menu and I can't see the others.
This is where I place the option:
Expand|Select|Wrap|Line Numbers
  1. addSubmenuItem("registration.htm","Policy and Registration &amp;gt;","","");
Oct 9 '07 #9
acoder
16,027 Expert Mod 8TB
So do you get an error? If so, what's the error?

Please use code tags when posting code:
[CODE=javascript]
JavaScript code here.
[/code]
Oct 9 '07 #10
Hi again Acoder,
Is working now, I think I did something wrong.
Now what I'd like to know is how can I make this > go at the end.
For example, if I have a submenu like this:
Vision >
I need the symbol to be at the end, having all the spaces in between the word Vision and the symbol. Do I need to add spaces? How can I do that?
Oct 9 '07 #11
acoder
16,027 Expert Mod 8TB
You could add spaces using &nbsp; but you probably wouldn't be able to align it correctly. You're better off right-aligning it while the text is left-aligned. You could use tables or CSS.
Oct 9 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Benoit | last post by:
Here is a quick view of what my program is doing: I am using a system hook to add a menu inside the system menu of my Internet Explorer. Everything seems to work fine for now , my submenu is...
1
by: Stefan | last post by:
I'd like to display the keyboard navigation indicators in my C# application without the user having to press the Alt key and regardless of the machines global setting (Hide keyboard navigation...
0
by: jeff.perreault | last post by:
I have a problem with a skmMenu submenu and I think it has to do with an IIS Setting. I have the same website set up on two servers - One is MS 2003, the other is MS 2003 R2 If I load the web...
5
by: Jonathan | last post by:
Hello All, I am in the process of creating a 2/3 level collapsible/exspanible menu (called "nav") where users can click on a category and have the submenus appear beneath it and so on (allow...
0
Denburt
by: Denburt | last post by:
This code is for a Toggle Button layout on a form, with this code you can set a number of toggle buttons visible and have multiple submenus that will stay hidden when not in use. My main menu is set...
2
by: az538 | last post by:
Hello All, I am having a problem with my menu and submenu system. It works like a champ in IE6 and Firefox but IE7 renders the submenus in incorrect positions on the page. Also, the menu system...
0
by: jobs | last post by:
On the asp.net 2.0 menu control under vs 2005. Any way to remove that black arrow on menu items that have a submenu? Any way to equally size menu items dispite text site of menu item? Thanks...
1
by: bhosalevivek | last post by:
I did this code from Dynamic Drive DHTML. it's working properly, but now I need submenu for "Submenu 1.2", means when I take mouse on "Submenu 1.2" I need to display "Submenu 1.2.1". I try to do...
1
oll3i
by: oll3i | last post by:
i have written css tab menu but my links in submenu inherit the style of a href in main menu (#menu ul li a)? when i hover over the links in submenu they do change as i want them to change they...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.